package cn.zyq.ykb.controller.h5.task;

import org.springframework.security.access.prepost.PreAuthorize;
import cn.zyq.ykb.system.ry.util.poi.ExcelUtil;
import cn.zyq.ykb.system.common.BaseController;
import cn.zyq.ykb.system.annotation.Log;
import cn.zyq.ykb.system.ry.enums.BusinessType;
import cn.zyq.ykb.beans.task.MyTask;
import cn.zyq.ykb.service.task.MyTaskService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import cn.zyq.ykb.system.common.BaseController;
import cn.zyq.ykb.system.common.PageParam;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 我的任务领取Controller
 *
 * @author SystemAuth
 * @date 2023-05-22
 */

@RestController(value = "H5MyTaskController")
@RequestMapping("/api/myTask")
@Api(tags = "我的任务领取接口")
public class MyTaskController extends BaseController {

    @Autowired
    private MyTaskService myTaskService;

    /**
     * 查询我的任务领取列表
     */
    @ApiOperation(value = "列表", response = MyTask.class)
    @PostMapping("/list")
    public Object list(@RequestBody PageParam pageParam) {
        return this.myTaskService.selectMyTaskList(pageParam,this.getLoginUser());
    }

    /**
     * 领取详情
     */
    @ApiOperation(value = "领取详情", response = MyTask.class)
    @GetMapping("/detail/{myTaskID}")
    public Object detail(@PathVariable("myTaskID") Integer myTaskID) {
        return this.myTaskService.detail(myTaskID,this.getLoginUser());
    }
}
